Avoid unnecessary indirect call
authorAlexander Larsson <alexl@redhat.com>
Thu, 23 Jul 2009 19:52:32 +0000 (21:52 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 23 Jul 2009 20:03:15 +0000 (22:03 +0200)
Call klass->draw_pixbuf directly inside gdk_window_draw_pixbuf
instead of gdk_draw_pixbuf to avoid doing all checks twice.

gdk/gdkwindow.c

index ab2c3966cfd11e32f39e940c6d676cc0d7bf41d7..374a69c3a2003b425ec828d1499df560d6fe3fc3 100644 (file)
@@ -4225,6 +4225,7 @@ gdk_window_draw_pixbuf (GdkDrawable     *drawable,
                        gint             y_dither)
 {
   GdkWindowObject *private = (GdkWindowObject *)drawable;
+  GdkDrawableClass *klass;
 
   if (GDK_WINDOW_DESTROYED (drawable))
     return;
@@ -4235,16 +4236,19 @@ gdk_window_draw_pixbuf (GdkDrawable     *drawable,
     gc = _gdk_drawable_get_scratch_gc (drawable, FALSE);
 
   BEGIN_DRAW;
+
+  klass = GDK_DRAWABLE_GET_CLASS (impl);
+
   if (private->paint_stack)
-    gdk_draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
-                    dest_x - x_offset, dest_y - y_offset,
-                    width, height,
-                    dither, x_dither - x_offset, y_dither - y_offset);
+    klass->draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
+                       dest_x - x_offset, dest_y - y_offset,
+                       width, height,
+                       dither, x_dither - x_offset, y_dither - y_offset);
   else
-    gdk_draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
-                    dest_x - x_offset, dest_y - y_offset,
-                    width, height,
-                    dither, x_dither, y_dither);
+    klass->draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
+                       dest_x - x_offset, dest_y - y_offset,
+                       width, height,
+                       dither, x_dither, y_dither);
   END_DRAW;
 }